package com.book.bookshop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.book.bookshop.entity.enums.Category;
import com.book.bookshop.entity.enums.Suit;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.solr.client.solrj.beans.Field;

import java.util.Date;


@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "bs_book")
public class BookVo extends Model<BookVo> {
    @Field("id")
    private String id;
    @Field("isbn_ik")
    private String isbn;
    @Field("name_ik")
    private String name;
    @Field("author_ik")
    private String author;
    @Field("publisher_ik")
    private String publisher;
    @Field("publishDate_dt")
    private Date publishDate;
    @Field("oldPrice_td")
    private double oldPrice;
    @Field("newPrice_td")
    private double newPrice;
    @Field("authorLoc_s")
    private String authorLoc;

    @Field("suit_i")
    private Integer suit;

    @Field("category_i")
    private Integer category;
    @Field("info_ik")//为空就不加入solr
    private String info;
    @Field("imgUrl_s")
    private String imgUrl;

    public BookVo(String id, String isbn, String name, String author, String publisher, Date publishDate) {
        this.id = id;
        this.isbn = isbn;
        this.name = name;
        this.author = author;
        this.publisher = publisher;
        this.publishDate = publishDate;
    }
}
